package com.hdwe.tools.pm.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hdwe.tools.pm.domain.PmTask;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.time.LocalDateTime;

/**
 * 任务业务对象 pm_task
 *
 * @author s
 * @date 2024-12-10
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = PmTask.class, reverseConvertGenerate = false)
public class PmTaskBo extends BaseEntity {

    /**
     * 主键
     */
    private Long id;

    /**
     * 标题
     */
    @NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class })
    private String title;

    /**
     * 项目id
     */
    @NotNull(message = "项目id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long projectId;

    /**
     * 需求id
     */
    private Long requireId;

    /**
     * 里程碑id
     */
    @NotNull(message = "里程碑id不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long milestoneId;

    /**
     * 内容
     */
    private String content;

    /**
     * 任务类型（dev开发任务 customer客户工单 tec技术选型 doc文档编写 test测试任务）
     */
    @NotBlank(message = "任务类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String taskType;

    /**
     * 优先级（low低 middle中 high高）
     */
    @NotBlank(message = "优先级不能为空", groups = { AddGroup.class, EditGroup.class })
    private String priority;

    /**
     * 负责人
     */
    @NotBlank(message = "负责人不能为空", groups = { AddGroup.class, EditGroup.class })
    private String owner;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private LocalDateTime startDate;

    /**
     * 截止时间（从需求或小目标同步，不可修改）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endDate;

    /**
     * 耗时
     */
    private Long costTime;

    /**
     * 图片、文件
     */
    private String files;

    /**
     * 任务标签
     */
    private String tags;

    /**
     * 关联人员
     */
    private String relatedUsers;

    /**
     * 状态（未开始ready 进行中doing 完成finished 阻塞blocked 取消cancel 延期delay）
     */
    @NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;


}
